// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init()
// wx-server-sdk开发类似 wx.cloud
// 云函数入口函数
exports.main = async (event, context) => {
  // await 返回的结果是Promise
  const _=cloud.database().command;
  // 清空收藏
  let result = await cloud.database().collection("movie_store").where({
    "collecttime":_.lt(new Date().getTime())
  }).remove();
  // let resImg = await cloud.database().collection("user_bg").where({
  //   "username":_.exists(true)
  // }).remove();
  console.log("result删除结果==>",result)
  // console.log("resImg删除结果==>",resImg)
  return {
    result,
    resImg,
  };
}